﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage/Admin.Master"
    CodeBehind="Recommend.aspx.vb" Inherits="GoodAnotApp.AddShopOutlets" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        #TextArea1
        {
            height: 81px;
            width: 491px;
        }
        #txtADetails
        {
            height: 70px;
            width: 407px;
        }
        #tbxShopURL
        {
        }
        .style6
        {
            width: 906px;
        }
        #Text5
        {
            height: 24px;
            width: 451px;
        }
        #tbxShopOutletAddress
        {
            height: 28px;
            width: 368px;
        }
        #tbxShopURL0
        {
            height: 25px;
            width: 426px;
        }
        #tbxShopURL0
        {
            height: 25px;
            width: 426px;
        }
        #tbxShopAddress
        {
            width: 337px;
        }
        #tbxShopURL0
        {
            height: 25px;
            width: 426px;
        }
        #tbxShopAddress0
        {
            width: 337px;
        }
        #tbxShopOutletAddress0
        {
            height: 28px;
            width: 368px;
        }
        
        
        #NewExsistingBusiness
        {
            width: 427px;
            border: 1px solid #ddd;
        }
        .style7
        {
            width: 642px;
        }
        .style9
        {
            width: 263px;
        }
        .style10
        {
            width: 270px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:Label ID="LoginLabel" runat="server" Text="Please kindly login to recommend a company or branch."
        ForeColor="Red" Visible="False"></asp:Label>
    <asp:Panel ID="RecommendPanel" runat="server" Visible="False">
        <div id="AddShopNOutlets" style="top: 300px; margin-left: 10px; width: 945px;">
            <asp:HiddenField ID="hfCheck" runat="server" />
            <asp:Label ID="lbNotify" runat="server" 
                Text="Note: If you are going to add a company , make sure you add a branch together with it ."></asp:Label>
            <table style="width: 100%" id="AddShopOutletsTable">
                <tr>
                    <td class="NewExsistingBusiness" style="border-top: 0px">
                        <asp:RadioButtonList ID="rblBusinessType" runat="server" AutoPostBack="True" Width="397px"
                            BorderWidth="3px" BorderColor="Black">
                            <asp:ListItem Value="1" Text="New Company" />
                            <asp:ListItem Value="0" Text="Exsisting Company" />
                        </asp:RadioButtonList>
                        <br />
                        <br />
                        &nbsp;&nbsp;&nbsp;
                        <asp:Panel ID="SearchPanel" DefaultButton="btnSearch" runat="server" Visible="False">
                            <asp:TextBox ID="tbxSearch" runat="server"></asp:TextBox>
                            &nbsp;&nbsp;&nbsp;
                            <asp:Button ID="btnSearch" runat="server" Text="Search" />
                        </asp:Panel>
                    </td>
                    <td class="style6" style="border-top: 0px">
                        <asp:Panel ID="BusinessDetailPanel" runat="server" Width="500px">
                            <table class="bordered-table" style="width: 50%; height: 181px;" width="500px">
                                <tr>
                                    <td class="style23" style="border-top: 0px">
                                        Company Name :
                                    </td>
                                    <td colspan="2" style="border-top: 0px">
                                        <asp:TextBox ID="tbxBusinessName" runat="server" Width="374px" MaxLength="99"></asp:TextBox>
                                        &nbsp;&nbsp;
                                        <asp:Label ID="lblBusinessNameValidator" runat="server" Text="Please kindly key in the Company name"
                                            Visible="False"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style23">
                                        Category:
                                    </td>
                                    <td colspan="2">
                                        <div class="input select" style="margin-left: -4px; margin-right: 10px">
                                            <asp:DropDownList ID="ddlCategory" runat="server" AutoPostBack="False">
                                                <asp:ListItem>Any Categories</asp:ListItem>
                                                <asp:ListItem>Retail</asp:ListItem>
                                                <asp:ListItem>Fashion &amp; Clothing</asp:ListItem>
                                                <asp:ListItem>Beauty &amp; Sports</asp:ListItem>
                                                <asp:ListItem>Home &amp; Electronics</asp:ListItem>
                                                <asp:ListItem>Books &amp; Music</asp:ListItem>
                                                <asp:ListItem>Entertainment</asp:ListItem>
                                                <asp:ListItem>Night Clubs</asp:ListItem>
                                                <asp:ListItem>Gaming </asp:ListItem>
                                                <asp:ListItem>Cinema</asp:ListItem>
                                                <asp:ListItem>Arts</asp:ListItem>
                                                <asp:ListItem>Museums</asp:ListItem>
                                                <asp:ListItem>Education</asp:ListItem>
                                                <asp:ListItem>Tuition Centre</asp:ListItem>
                                                <asp:ListItem>Enrichment Classes</asp:ListItem>
                                                <asp:ListItem>Health &amp; Beauty</asp:ListItem>
                                                <asp:ListItem>Doctors</asp:ListItem>
                                                <asp:ListItem>Dentists</asp:ListItem>
                                                <asp:ListItem>Clinics</asp:ListItem>
                                                <asp:ListItem>Medical Spa / Spa</asp:ListItem>
                                                <asp:ListItem>Massage</asp:ListItem>
                                                <asp:ListItem>Makeup Artist</asp:ListItem>
                                                <asp:ListItem>Pets</asp:ListItem>
                                                <asp:ListItem>Pet Accessories</asp:ListItem>
                                                <asp:ListItem>Veterinarians</asp:ListItem>
                                            </asp:DropDownList>
                                            <asp:Label ID="lblCategoryValidator" runat="server" Text="Please kindly select a category"
                                                Visible="False"></asp:Label>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style23">
                                        Website :
                                    </td>
                                    <td colspan="2">
                                        <asp:TextBox ID="tbxShopURL" runat="server" Width="376px" MaxLength="149"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style23">
                                        Details :
                                    </td>
                                    <td colspan="2">
                                        <asp:TextBox ID="tbxShopDetails" runat="server" Width="394px" Height="102px" TextMode="MultiLine"
                                            MaxLength="999"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="style23">
                                        Image :
                                    </td>
                                    <td class="style10">
                                        &nbsp;
                                        <asp:FileUpload ID="fileuploadImage" runat="server" />
                                        <asp:Button ID="btnUpload" runat="server" Text="Upload" />
                                    </td>
                                    <td>
                                        <table>
                                            <tr>
                                                <td style="border-top: 0px">
                                                    <asp:Image ID="ImgCompany" runat="server" Height="100px" Width="100px" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td style="border-top: 0px">
                                                    <asp:Label ID="lbDefault" runat="server" Text="This is a default image" Visible="False"></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <br />
                    </td>
                </tr>
            </table>
            <asp:HiddenField ID="hfImageID" runat="server" />
            <asp:HiddenField ID="hfCheckUpload" runat="server" />
            <table style="width: 100%" width="715px">
                <tr>
                    <td style="border-top: 0px" class="style9">
                        <asp:Panel ID="SearchResultPanel" runat="server" Visible="False">
                            <asp:ListView ID="SearchResult" runat="server" DataSourceID="SqlDataSourceSearchResults"
                                DataKeyNames="business_ID">
                                <EditItemTemplate>
                                    <span style="">name:
                                        <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
                                        <br />
                                        website:
                                        <asp:TextBox ID="websiteTextBox" runat="server" Text='<%# Bind("website") %>' />
                                        <br />
                                        details:
                                        <asp:TextBox ID="detailsTextBox" runat="server" Text='<%# Bind("details") %>' />
                                        <br />
                                        <asp:Label ID="business_IDLabel1" runat="server" Text='<%# Eval("business_ID") %>'
                                            Visible="False" />
                                        <br />
                                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Cancel" />
                                        <br />
                                        <br />
                                    </span>
                                </EditItemTemplate>
                                <EmptyDataTemplate>
                                    <span>No data was returned.</span>
                                </EmptyDataTemplate>
                                <InsertItemTemplate>
                                    <span style="">name:
                                        <asp:TextBox ID="nameTextBox" runat="server" Text='<%# Bind("name") %>' />
                                        <br />
                                        website:
                                        <asp:TextBox ID="websiteTextBox" runat="server" Text='<%# Bind("website") %>' />
                                        <br />
                                        details:
                                        <asp:TextBox ID="detailsTextBox" runat="server" Text='<%# Bind("details") %>' />
                                        <br />
                                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert" />
                                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" Text="Clear" />
                                        <br />
                                        <br />
                                    </span>
                                </InsertItemTemplate>
                                <ItemTemplate>
                                    <table border="0" width="100%">
                                        <tr>
                                            <td height="35px" style="font-size: 1.5em; font-weight: bold">
                                                <asp:LinkButton ID="lbname" runat="server" CommandArgument='<%# Eval("business_ID") %>'
                                                    CommandName="selectBusiness">'<%# Eval("name") %>'</asp:LinkButton>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height="35px">
                                                <asp:HyperLink ID="hlWebsite" runat="server" Text='<%# Eval("website") %>' NavigateUrl='<%# Eval("website") %>'></asp:HyperLink>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td height="35px">
                                                <asp:Label ID="BusinessDetails" runat="server" Text='<%# Eval("details") %>' />
                                            </td>
                                        </tr>
                                    </table>
                                </ItemTemplate>
                                <LayoutTemplate>
                                    <div id="itemPlaceholderContainer" runat="server" style="">
                                        <span runat="server" id="itemPlaceholder" />
                                    </div>
                                    <div style="">
                                    </div>
                                </LayoutTemplate>
                                <SelectedItemTemplate>
                                    <span style="">name:
                                        <asp:Label ID="nameLabel" runat="server" Text='<%# Eval("name") %>' />
                                        <br />
                                        website:
                                        <asp:Label ID="websiteLabel" runat="server" Text='<%# Eval("website") %>' />
                                        <br />
                                        details:
                                        <asp:Label ID="detailsLabel" runat="server" Text='<%# Eval("details") %>' />
                                        <br />
                                        business_ID:
                                        <asp:Label ID="business_IDLabel" runat="server" Text='<%# Eval("business_ID") %>' />
                                        <br />
                                        <br />
                                    </span>
                                </SelectedItemTemplate>
                            </asp:ListView>
                        </asp:Panel>
                    </td>
                    <td style="border-top: 0px">
                        <div align="right">
                            <asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSourceDisplayOutletDetails"
                                AutoGenerateColumns="False" CellPadding="4" ForeColor="#333333" GridLines="None"
                                Width="500px" ShowHeaderWhenEmpty="True">
                                <AlternatingRowStyle BackColor="White" />
                                <Columns>
                                    <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
                                    <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
                                    <asp:BoundField DataField="Phone No." HeaderText="Phone No." SortExpression="Phone No." />
                                    <asp:BoundField DataField="Opening Hours" HeaderText="Opening Hours" SortExpression="Opening Hours" />
                                    <asp:BoundField DataField="Remarks" HeaderText="Remarks" SortExpression="Remarks" />
                                </Columns>
                                <EditRowStyle BackColor="#2461BF" />
                                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                                <RowStyle BackColor="#EFF3FB" />
                                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                <SortedAscendingCellStyle BackColor="#F5F7FB" />
                                <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                                <SortedDescendingCellStyle BackColor="#E9EBEF" />
                                <SortedDescendingHeaderStyle BackColor="#4870BE" />
                            </asp:GridView>
                            <asp:HiddenField ID="hfBusinessID" runat="server" />
                            <asp:SqlDataSource ID="SqlDataSourceDisplayOutletDetails" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                                SelectCommand="SELECT outlet.name AS Name, outlet.address AS Address, outlet.opening_hours AS [Opening Hours], outlet.remarks AS Remarks, outlet.phone_no AS [Phone No.] FROM business INNER JOIN outlet ON business.business_ID = outlet.business_ID WHERE (outlet.business_ID = @business_ID)"
                                ProviderName="System.Data.SqlClient">
                                <SelectParameters>
                                    <asp:ControlParameter ControlID="hfBusinessID" DefaultValue="" Name="business_ID"
                                        PropertyName="Value" />
                                </SelectParameters>
                            </asp:SqlDataSource>
                            <table class="bordered-table" style="margin-bottom: 0px" width="500px">
                                <tr>
                                    <td style="border-top: 0px" colspan="2">
                                        New branch
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Branch Name :
                                    </td>
                                    <td>
                                        <asp:TextBox ID="tbxShopOutletName" runat="server" Width="300px" MaxLength="99"></asp:TextBox>
                                        <asp:Label ID="lblValidatorON" runat="server" Text="Please kindly key in the branch name "
                                            Visible="False"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Branch Address:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="tbxOutletAddress" runat="server" Width="300px" MaxLength="199"></asp:TextBox>
                                        <asp:Label ID="lblValidatorOA" runat="server" Text="Please kindly key in the branch address"
                                            Visible="False"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Phone No:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="tbxShopOutletTel" runat="server" Width="300px" MaxLength="20"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Opening hours:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="tbxOpeningHours" runat="server" Width="300px" MaxLength="29"></asp:TextBox>
                                        <asp:Label ID="lblValidatorOP" runat="server" Text="Please kindly key in the opening hours"
                                            Visible="False"></asp:Label>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        Remarks:
                                    </td>
                                    <td>
                                        <asp:TextBox ID="tbxRemarks" runat="server" Height="60px" TextMode="MultiLine" Width="300px"
                                            MaxLength="299"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" colspan="2" dir="rtl">
                                        <asp:Button ID="BtnDoneOD" runat="server" Text="Done" Visible="False" />
                                        &nbsp;&nbsp;
                                        <asp:Button ID="BtnAddMoreOutlets" runat="server" Text="Add More Outlets" />
                                    </td>
                                </tr>
                            </table>
                            <table class="bordered-table" style="border:0px">
                                <tr>
                                    <td colspan="2" style="border: 0px; border-top: 1px">
                                        <asp:Button ID="AddNewCompanybtn" class="btn danger" runat="server" Text="Add New Company" />
                                        &nbsp;&nbsp;
                                        <asp:Button ID="AddAnotherNewCompany" class="btn danger" runat="server" Text="Add Another New Company" />
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td class="style9" style="border-top: 0px">
                        <asp:SqlDataSource ID="SqlDataSourceSearchResults" runat="server" ConnectionString="<%$ ConnectionStrings:yijungoodAnotDBConnectionString %>"
                            SelectCommand="SELECT name, website, details, business_ID FROM business WHERE (name LIKE '%' + @search + '%')"
                            ProviderName="System.Data.SqlClient">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="tbxSearch" DefaultValue="" Name="search" PropertyName="Text" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td>
                    <td class="style7" style="border-top: 0px" align="justify">
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
    </asp:Panel>
</asp:Content>
